export interface FirstContentfulPaint {
  id: string
  title: string
  description: string
  score: number
  scoreDisplayMode: string
  numericValue: number
  numericUnit: string
  displayValue: string
}

export interface FinalScreenshot {
  id: string
  title: string
  description: string
  score?: number
  scoreDisplayMode: string
  details: {
    type: string
    timing: number
    timestamp: number
    data: string
  }
}

export interface ScreenshotThumbnails {
  id: string
  title: string
  description: string
  score?: number
  scoreDisplayMode: string
  details: {
    type: string
    scale: number
    items: {
      timing: number
      timestamp: number
      data: string
    }[]
  }
}

export interface ResourceSummary {
  id: string
  title: string
  description: string
  score?: any
  scoreDisplayMode: string
  displayValue: string
  details: {
    type: string
    headings: {
      key: string
      itemType: string
      text: string
    }[]
    items: {
      resourceType: string
      label: string
      requestCount: number
      transferSize: number
    }[]
  }
}

export interface DetailAudits {
  "first-contentful-paint": FirstContentfulPaint
  "final-screenshot": FinalScreenshot
  "screenshot-thumbnails": ScreenshotThumbnails
  "resource-summary": ResourceSummary
}

export interface AuditRefs {
  group: string
  id: string
  weight: number
}

export interface Categories {
  performance: {
    auditRefs: AuditRefs[]
    id: string
    score: number
    title: string
  }
}

export interface DetailResult {
  audits: DetailAudits
  categories: Categories
}
